require(['./config'],()=>{
    require(['cookie','footer'],()=>{
        class Login{
            constructor(){
                this.Login1()
            }
            Login1(){                
                $('.login-input').on('click',function(){
                    var username=$('.userName').val()
                    var password=$('.passWord').val()
                    var userList=localStorage.getItem('userList')
                    if(userList){
                        userList=JSON.parse(userList)
                        var isExist=userList.some(user=>{
                            return user.username===username&&user.password===password
                            
                        })
                        if(isExist){
                            $.cookie('userList',JSON.stringify(userList),{expires:7,path:'/'})
                            window.open('/index.html')
                        }
                    }
                })
            }
            
        }
        new Login()
    })
})